package my.design.combination.service.engine.impl;

import my.design.combination.model.aggregates.TreeRich;
import my.design.combination.model.vo.EngineResult;
import my.design.combination.model.vo.TreeNode;
import my.design.combination.service.engine.EngineBase;

import java.util.Map;

/**
 * @author zp
 * @version 1.0
 * @description: 流程决策器 把不同的数据 分发给不同的处理器处理 起到连接作用
 * @date 2022/10/13 20:38
 */
public class TreeEngineHandle extends EngineBase {
    @Override
    public EngineResult process(Long treeId, String userId, TreeRich treeRich, Map<String, String> decisionMatter) {
        // 决策流程
        TreeNode treeNode = engineDecisionMaker(treeRich, treeId, userId, decisionMatter);
        // 决策结果
        return new EngineResult(userId, treeId, treeNode.getTreeNodeId(), treeNode.getNodeValue());
    }
}
